3.3.44 \(\int \sqrt {-\sec (e+f x)} \sqrt {a-a \sec (e+f x)} \, dx\) [244]

Optimal. Leaf size=38 \[ \frac {2 \sqrt {a} \sinh ^{-1}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a-a \sec (e+f x)}}\right )}{f} \]

[Out]

2*arcsinh(a^(1/2)*tan(f*x+e)/(a-a*sec(f*x+e))^(1/2))*a^(1/2)/f

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.071, Rules used = {3886, 221} \begin {gather*} \frac {2 \sqrt {a} \sinh ^{-1}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a-a \sec (e+f x)}}\right )}{f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[-Sec[e + f*x]]*Sqrt[a - a*Sec[e + f*x]],x]

[Out]

(2*Sqrt[a]*ArcSinh[(Sqrt[a]*Tan[e + f*x])/Sqrt[a - a*Sec[e + f*x]]])/f

Rule 221

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSinh[Rt[b, 2]*(x/Sqrt[a])]/Rt[b, 2], x] /; FreeQ[{a, b},
 x] && GtQ[a, 0] && PosQ[b]

Rule 3886

Int[Sqrt[csc[(e_.) + (f_.)*(x_)]*(d_.)]*Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Dist[-2*(a/(b
*f))*Sqrt[a*(d/b)], Subst[Int[1/Sqrt[1 + x^2/a], x], x, b*(Cot[e + f*x]/Sqrt[a + b*Csc[e + f*x]])], x] /; Free
Q[{a, b, d, e, f}, x] && EqQ[a^2 - b^2, 0] && GtQ[a*(d/b), 0]

Rubi steps

\begin {align*} \int \sqrt {-\sec (e+f x)} \sqrt {a-a \sec (e+f x)} \, dx &=\frac {2 \text {Subst}\left (\int \frac {1}{\sqrt {1+\frac {x^2}{a}}} \, dx,x,\frac {a \tan (e+f x)}{\sqrt {a-a \sec (e+f x)}}\right )}{f}\\ &=\frac {2 \sqrt {a} \sinh ^{-1}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a-a \sec (e+f x)}}\right )}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 1.93, size = 299, normalized size = 7.87 \begin {gather*} \frac {\csc \left (\frac {1}{2} (e+f x)\right ) \left (-2 i \text {ArcTan}\left (\frac {\cos \left (\frac {1}{4} (e+f x)\right )-\left (-1+\sqrt {2}\right ) \sin \left (\frac {1}{4} (e+f x)\right )}{\left (1+\sqrt {2}\right ) \cos \left (\frac {1}{4} (e+f x)\right )-\sin \left (\frac {1}{4} (e+f x)\right )}\right )+2 i \text {ArcTan}\left (\frac {\cos \left (\frac {1}{4} (e+f x)\right )-\left (1+\sqrt {2}\right ) \sin \left (\frac {1}{4} (e+f x)\right )}{\left (-1+\sqrt {2}\right ) \cos \left (\frac {1}{4} (e+f x)\right )-\sin \left (\frac {1}{4} (e+f x)\right )}\right )-4 \tanh ^{-1}\left (\sqrt {2} \cos \left (\frac {1}{4} (2 e+f x)\right ) \sec \left (\frac {f x}{4}\right )+\tan \left (\frac {f x}{4}\right )\right )+\log \left (2-\sqrt {2} \cos \left (\frac {1}{2} (e+f x)\right )-\sqrt {2} \sin \left (\frac {1}{2} (e+f x)\right )\right )-\log \left (2+\sqrt {2} \cos \left (\frac {1}{2} (e+f x)\right )-\sqrt {2} \sin \left (\frac {1}{2} (e+f x)\right )\right )\right ) \sqrt {a-a \sec (e+f x)}}{2 \sqrt {2} f \sqrt {-\sec (e+f x)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[-Sec[e + f*x]]*Sqrt[a - a*Sec[e + f*x]],x]

[Out]

(Csc[(e + f*x)/2]*((-2*I)*ArcTan[(Cos[(e + f*x)/4] - (-1 + Sqrt[2])*Sin[(e + f*x)/4])/((1 + Sqrt[2])*Cos[(e +
f*x)/4] - Sin[(e + f*x)/4])] + (2*I)*ArcTan[(Cos[(e + f*x)/4] - (1 + Sqrt[2])*Sin[(e + f*x)/4])/((-1 + Sqrt[2]
)*Cos[(e + f*x)/4] - Sin[(e + f*x)/4])] - 4*ArcTanh[Sqrt[2]*Cos[(2*e + f*x)/4]*Sec[(f*x)/4] + Tan[(f*x)/4]] +
Log[2 - Sqrt[2]*Cos[(e + f*x)/2] - Sqrt[2]*Sin[(e + f*x)/2]] - Log[2 + Sqrt[2]*Cos[(e + f*x)/2] - Sqrt[2]*Sin[
(e + f*x)/2]])*Sqrt[a - a*Sec[e + f*x]])/(2*Sqrt[2]*f*Sqrt[-Sec[e + f*x]])

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(123\) vs. \(2(32)=64\).
time = 0.21, size = 124, normalized size = 3.26

method result size
default \(\frac {\left (\arctanh \left (\frac {\sqrt {\frac {1}{\cos \left (f x +e \right )+1}}\, \left (1+\cos \left (f x +e \right )-\sin \left (f x +e \right )\right )}{2}\right )+\arctanh \left (\frac {\sqrt {\frac {1}{\cos \left (f x +e \right )+1}}\, \left (1+\cos \left (f x +e \right )+\sin \left (f x +e \right )\right )}{2}\right )\right ) \cos \left (f x +e \right ) \sqrt {-\frac {1}{\cos \left (f x +e \right )}}\, \sqrt {\frac {a \left (-1+\cos \left (f x +e \right )\right )}{\cos \left (f x +e \right )}}}{f \sin \left (f x +e \right ) \sqrt {\frac {1}{\cos \left (f x +e \right )+1}}}\) \(124\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-sec(f*x+e))^(1/2)*(a-a*sec(f*x+e))^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/f*(arctanh(1/2*(1/(cos(f*x+e)+1))^(1/2)*(1+cos(f*x+e)-sin(f*x+e)))+arctanh(1/2*(1/(cos(f*x+e)+1))^(1/2)*(1+c
os(f*x+e)+sin(f*x+e))))*cos(f*x+e)*(-1/cos(f*x+e))^(1/2)*(a*(-1+cos(f*x+e))/cos(f*x+e))^(1/2)/sin(f*x+e)/(1/(c
os(f*x+e)+1))^(1/2)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 385 vs. \(2 (34) = 68\).
time = 0.59, size = 385, normalized size = 10.13 \begin {gather*} -\frac {\sqrt {a} {\left (\log \left (2 \, \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right )^{2} + 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right ) + 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right ) + 2\right ) + \log \left (2 \, \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right )^{2} + 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right ) - 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right ) + 2\right ) - \log \left (2 \, \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right )^{2} - 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right ) + 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right ) + 2\right ) - \log \left (2 \, \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right )^{2} - 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right ) - 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right )\right )\right ) + 2\right )\right )}}{2 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-sec(f*x+e))^(1/2)*(a-a*sec(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

-1/2*sqrt(a)*(log(2*cos(1/2*arctan2(sin(f*x + e), cos(f*x + e)))^2 + 2*sin(1/2*arctan2(sin(f*x + e), cos(f*x +
 e)))^2 + 2*sqrt(2)*cos(1/2*arctan2(sin(f*x + e), cos(f*x + e))) + 2*sqrt(2)*sin(1/2*arctan2(sin(f*x + e), cos
(f*x + e))) + 2) + log(2*cos(1/2*arctan2(sin(f*x + e), cos(f*x + e)))^2 + 2*sin(1/2*arctan2(sin(f*x + e), cos(
f*x + e)))^2 + 2*sqrt(2)*cos(1/2*arctan2(sin(f*x + e), cos(f*x + e))) - 2*sqrt(2)*sin(1/2*arctan2(sin(f*x + e)
, cos(f*x + e))) + 2) - log(2*cos(1/2*arctan2(sin(f*x + e), cos(f*x + e)))^2 + 2*sin(1/2*arctan2(sin(f*x + e),
 cos(f*x + e)))^2 - 2*sqrt(2)*cos(1/2*arctan2(sin(f*x + e), cos(f*x + e))) + 2*sqrt(2)*sin(1/2*arctan2(sin(f*x
 + e), cos(f*x + e))) + 2) - log(2*cos(1/2*arctan2(sin(f*x + e), cos(f*x + e)))^2 + 2*sin(1/2*arctan2(sin(f*x
+ e), cos(f*x + e)))^2 - 2*sqrt(2)*cos(1/2*arctan2(sin(f*x + e), cos(f*x + e))) - 2*sqrt(2)*sin(1/2*arctan2(si
n(f*x + e), cos(f*x + e))) + 2))/f

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 97 vs. \(2 (34) = 68\).
time = 2.62, size = 233, normalized size = 6.13 \begin {gather*} \left [\frac {\sqrt {a} \log \left (\frac {4 \, {\left (\cos \left (f x + e\right )^{3} + 3 \, \cos \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right )\right )} \sqrt {a} \sqrt {\frac {a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right )}} \sqrt {-\frac {1}{\cos \left (f x + e\right )}} + {\left (a \cos \left (f x + e\right )^{2} + 8 \, a \cos \left (f x + e\right ) + 8 \, a\right )} \sin \left (f x + e\right )}{\cos \left (f x + e\right )^{2} \sin \left (f x + e\right )}\right )}{2 \, f}, -\frac {\sqrt {-a} \arctan \left (\frac {2 \, {\left (\cos \left (f x + e\right )^{2} + \cos \left (f x + e\right )\right )} \sqrt {-a} \sqrt {\frac {a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right )}} \sqrt {-\frac {1}{\cos \left (f x + e\right )}}}{{\left (a \cos \left (f x + e\right ) + 2 \, a\right )} \sin \left (f x + e\right )}\right )}{f}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-sec(f*x+e))^(1/2)*(a-a*sec(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

[1/2*sqrt(a)*log((4*(cos(f*x + e)^3 + 3*cos(f*x + e)^2 + 2*cos(f*x + e))*sqrt(a)*sqrt((a*cos(f*x + e) - a)/cos
(f*x + e))*sqrt(-1/cos(f*x + e)) + (a*cos(f*x + e)^2 + 8*a*cos(f*x + e) + 8*a)*sin(f*x + e))/(cos(f*x + e)^2*s
in(f*x + e)))/f, -sqrt(-a)*arctan(2*(cos(f*x + e)^2 + cos(f*x + e))*sqrt(-a)*sqrt((a*cos(f*x + e) - a)/cos(f*x
 + e))*sqrt(-1/cos(f*x + e))/((a*cos(f*x + e) + 2*a)*sin(f*x + e)))/f]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {- \sec {\left (e + f x \right )}} \sqrt {- a \left (\sec {\left (e + f x \right )} - 1\right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-sec(f*x+e))**(1/2)*(a-a*sec(f*x+e))**(1/2),x)

[Out]

Integral(sqrt(-sec(e + f*x))*sqrt(-a*(sec(e + f*x) - 1)), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 98 vs. \(2 (32) = 64\).
time = 0.80, size = 98, normalized size = 2.58 \begin {gather*} \frac {\sqrt {2} {\left (\frac {\sqrt {2} a^{2} \arctan \left (\frac {\sqrt {2} \sqrt {a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + a}}{2 \, \sqrt {-a}}\right )}{\sqrt {-a}} - \frac {\sqrt {2} a^{2} \arctan \left (\frac {\sqrt {a}}{\sqrt {-a}}\right )}{\sqrt {-a}}\right )} {\left | a \right |} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}{a^{2} f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-sec(f*x+e))^(1/2)*(a-a*sec(f*x+e))^(1/2),x, algorithm="giac")

[Out]

sqrt(2)*(sqrt(2)*a^2*arctan(1/2*sqrt(2)*sqrt(a*tan(1/2*f*x + 1/2*e)^2 + a)/sqrt(-a))/sqrt(-a) - sqrt(2)*a^2*ar
ctan(sqrt(a)/sqrt(-a))/sqrt(-a))*abs(a)*sgn(tan(1/2*f*x + 1/2*e)^3 + tan(1/2*f*x + 1/2*e))/(a^2*f)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.03 \begin {gather*} \int \sqrt {a-\frac {a}{\cos \left (e+f\,x\right )}}\,\sqrt {-\frac {1}{\cos \left (e+f\,x\right )}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a - a/cos(e + f*x))^(1/2)*(-1/cos(e + f*x))^(1/2),x)

[Out]

int((a - a/cos(e + f*x))^(1/2)*(-1/cos(e + f*x))^(1/2), x)

________________________________________________________________________________________